'''
-*-  coding:  utf-8  -*-
Time    : 15:56
Auther  :罗老师
File    :login_page.py
'''
from common.basepage.basepage import *
from appium.webdriver.common.mobileby import MobileBy
from common.utils.data_util import *


class LoginPage(BasePage):
    def login_page(self):
        self.click(yuansu_excel("M1-m12"))
        self.click(yuansu_excel("M7-m1"))

    def input_login_phone(self):
        self.click(yuansu_excel("M8-m1"))
        self.click(yuansu_excel("M8-m2"))

    def input_login_pass(self):
        self.click(yuansu_excel("M8-m4"))
        self.click(yuansu_excel("M8-m5"))

    def login_by_phone(self, phone, password):
        self.login_page()
        self.input_login_phone()
        self.input(yuansu_excel("M8-m3"), phone)
        self.input_login_pass()
        self.input(yuansu_excel("M8-m6"), password)
        self.click(yuansu_excel("M8-m7"))
        return self.toast_check(lob=yuansu_excel("M8-m8"))
